/** * 2007-2023 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@buy-addons.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author Buy-addons * @copyright 2007-2023 Buy-addons * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ function updateQty(jsonData){ var html = ''; for(i=0;i'; html+= ''+jsonData[i].name+''; html+= ''; html+= '
'; html+= '

'+jsonData[i].name+'

';; if(jsonData[i].attr_dbboo == undefined){ html+= ' '; }else{ html+= ''+jsonData[i].attr_dbboo+''; } html+= '
'; if (jsonData.check_opt_price == 1) { html+= ''+ jsonData[i].price_tax_formatted+'
'; } else { html+= ''+ jsonData[i].price_tax_formatted +'
'; } html+= '
x'+jsonData[i].so_luong_sp+''; html+= '
'; html+= ''; html+= '
' html+= '
'; html+= ''; } if (jsonData.check_opt_price == 1) { html+= '
'; html+= 'Total:'; html+= ''; html+= jsonData.product_total_price_formatted; html+= ''; html+= '
'; } else { html+= ''; } jQuery(".quote_body").html(html); } function up_product(id_combi_up,id_pro_up){ var session_id_doubleboo = ss_id; var dp_count = jQuery('.count_dbboo'+ id_combi_up +'_' + id_pro_up + '').val(); var up = parseInt(dp_count) +1; jQuery('.count_dbboo'+ id_combi_up +'_' + id_pro_up +'').val(up); var price = jQuery('.price'+ id_combi_up +'_' + id_pro_up + '').attr('value'); var up_price = parseFloat(price) * up; var total_pri = jQuery('#dbboo').attr('value'); var up_total_pri = parseFloat(total_pri) + parseFloat(price); jQuery('#dbboo').attr('value', up_total_pri); jQuery('#dbboo').html('...'); jQuery('input[name="total_dbboo"]').val(up_total_pri.toFixed(2)); jQuery.ajax({ type: 'POST',//phương thức gửi crossDomain: true, jscrossDomain: window.location.hostname, url: askquote_base_url + 'index.php?controller=viewlist&fc=module&module=askforaquotemodul', // lấy link của controller mới data:'price_dbboo=' + up_price + '&total_pri_dbboo=' + up_total_pri + '&so_luong=' + up + '&name_btn=count' + '&id_combination_count=' + id_combi_up + '&sessionid_count=' + session_id_doubleboo + '"e_token=' + token_askaquotemodule + '&ajax=1' + '&id_product='+id_pro_up, // lấy dữ liệu từ id product ở trên định nghĩa dataType:"json", success: function(jsonData_up,textStatus,jqXHR) { updateQty(jsonData_up); jQuery('.price' +id_combi_up +'_' + id_pro_up).html(jsonData_up.product_pri_formatted); jQuery('.price' +id_combi_up +'_' + id_pro_up).parents("tr").find(".quote_unit_price").html(jsonData_up.unit_product_pri_formatted); jQuery('#dbboo').html(jsonData_up.product_total_price_formatted); } }); } function down_product(id_combi_down,id_pro_down){ var session_id_doubleboo = ss_id; var dp_count_down = jQuery('.count_dbboo'+ id_combi_down +'_' + id_pro_down + '').val(); if(dp_count_down > 1){ var down = parseInt(dp_count_down) -1; jQuery('.count_dbboo'+ id_combi_down +'_' + id_pro_down +'').val(down); var price_down = jQuery('.price'+ id_combi_down +'_' + id_pro_down + '').attr('value'); var down_price = parseFloat(price_down) * down; var total_pri_down = jQuery('#dbboo').attr('value'); var down_total_pri= parseFloat(total_pri_down) - parseFloat(price_down); jQuery('#dbboo').attr('value',down_total_pri); jQuery('#dbboo').html('...'); jQuery('input[name="total_dbboo"]').val(down_total_pri.toFixed(2)); jQuery.ajax({ type: 'POST',//phương thức gửi jscrossDomain: window.location.hostname, crossDomain: true, url: askquote_base_url + 'index.php?controller=viewlist&fc=module&module=askforaquotemodul', // lấy link của controller mới data:'price_dbboo=' + down_price + '&total_pri_dbboo=' + down_total_pri + '&so_luong=' + down + '&name_btn=count' + '&id_combination_count=' + id_combi_down + '&sessionid_count=' + session_id_doubleboo + '"e_token=' + token_askaquotemodule + '&ajax=1' + '&id_product=' + id_pro_down, // lấy dữ liệu từ id product ở trên định nghĩa dataType:"json", success: function(jsonData_down,textStatus,jqXHR) { updateQty(jsonData_down); jQuery('.price' +id_combi_down +'_' + id_pro_down).html(jsonData_down.product_pri_formatted); jQuery('.price' +id_combi_down +'_' + id_pro_down).parents("tr").find(".quote_unit_price").html(jsonData_down.unit_product_pri_formatted); jQuery('#dbboo').html(jsonData_down.product_total_price_formatted); } }); } }